package com.fsy.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fsy.entities.Book;
import com.fsy.entities.Member;
import com.fsy.entities.Member_excel;
import com.fsy.service.MemberService;
import com.fsy.mapper.MemberMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
* @author 凡凡
* @description 针对表【member】的数据库操作Service实现
* @createDate 2022-03-15 10:25:14
*/
@Service
public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member>
    implements MemberService{
    @Resource
    private MemberMapper memberMapper;
    /**
     * 查询全部人员
     * @param member
     * @return
     */
    public List<Member> findByMember(Member member){
        int page = member.getPage();
        int limit = member.getLimit();
        int offset = (page-1)*limit;
        member.setPage((page-1)*limit);
        member.setOffset(offset);//计算偏移量
        return memberMapper.findByMember(member);
    }

    /**
     * 导出excel表
     * @param member
     * @return
     */
    public List<Member_excel> exportMember(Member member){
        return memberMapper.exportMember(member);
    }

    /**
     * 查询全部人员条数
     * @param member
     * @return
     */
    public int selectMemberCounts(Member member){
        return memberMapper.selectMemberCounts(member);
    }

}




